<?php
namespace Pinenut\Log;

class File {
	static public function commit($beginTime, $endTime, $title, $data = null) {
		
		if (!\Application::isDebug()) 
			return; 
		
		$content = date(DATE_ATOM, $beginTime).' - '.sprintf("%0.3f", ($endTime-$beginTime) * 1000) ." ms"
			." - ".$title."\n";
		
		if (!empty($data)) 
			$content .= print_r($data, true)."\n";
			
		file_put_contents(\Application::logFile(), $content, FILE_APPEND);
	}
}
